package card_game;

public abstract class Card {
    private boolean available;

    /**
     * faceValue is 1-based.
     */
    protected int faceValue;
    protected Suit suit;

    public Card(int faceValue, Suit suit) {
	available = true;
	this.faceValue = faceValue;
	this.suit = suit;
    }

    public abstract int value();

    public Suit suit() {
	return suit;
    }

    public boolean isAvailable() {
	return available;
    }

    public void makeUnavailable() {
	available = false;
    }

    public void makeAvailable() {
	available = true;
    }

    public void print() {
	String[] faceValues = {
	    "A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"
	};
	System.out.print(faceValues[faceValue - 1]);
	switch (suit) {
	/**
	 * GQ.
	 * The qualified label Suit.Club must be replaced by unqualified enum constant.
	 */
//	case Suit.Club:
	case Club:
	    System.out.print("c");
	    break;
	case Diamond:
	    System.out.print("d");
	    break;
	case Heart:
	    System.out.print("h");
	    break;
	case Spade:
	    System.out.print("s");
	    break;
	}
	System.out.print(" ");
    }
}